package com.whjfxx.terminal.controller;

import com.whjfxx.terminal.biz.param.LoginParam;
import com.whjfxx.terminal.biz.service.UserService;
import com.whjfxx.terminal.biz.vo.LoginVo;
import com.whjfxx.terminal.commons.Result;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by b.c on 2022/4/8 11:14
 */
@RestController
@Log4j2
public class LoginController {

    @Autowired
    UserService userService;

    @PostMapping("login")
    public Result<LoginVo> login(LoginParam loginParam) {
        LoginVo loginVo = userService.signIn(loginParam);
        return Result.success(loginVo);
    }

}
